import mockjs from 'mockjs';

export default {
  'GET /api/tree': [
    {
      id: 'MyData',
      label: 'My Data',
      children: [
        {
          id: 'DeviceReach-ppid',
          label: 'DeviceReach-ppid',
          children: [
            {
              id: 'AdultComposition',
              label: 'AdultComposition',
            },
            {
              id: 'AdultComposition11',
              label: 'AdultComposition11',
            },
            {
              id: 'Age',
              label: 'Age',
            },
            {
              id: 'Education',
              label: 'Education',
            },
            {
              id: 'Gender',
              label: 'Gender',
            },
            {
              id: 'PresenceOfChild',
              label: 'PresenceOfChild',
            },
          ],
        },
      ],
    },
    {
      id: 'AnalyticsEnvironmentData',
      label: 'Analytics Environment Data',
      children: [{ id: 'RingRatio', label: 'Ring ratio' }],
    },
    {
      id: 'SavedAudiences',
      label: 'Saved Audiences',
      children: [{ id: 'averagePerson', label: 'average person' }],
    },
    {
      id: 'LookalikeGroup',
      label: 'Lookalike Group',
      children: [{ id: 'test', label: 'test' }],
    },
  ],
  'GET /api/selectOpts': (req, res) => {
    const { id } = req.query; // 数据分类
    res.json(
      mockjs.mock({
        'list|4-9': [{ id: '@id', label: '@name', value: '@integer(1, 50)' }],
      }),
    );
  },
};
